<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/global/global-head.jsp" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>吉车惠后台管理系统</title>
    <%@include file="/global/global-other.jsp" %>

    <script type="text/javascript">
        var $bn_advertisement_issue_list = new Object();
        var $bn_advertisement_issue_list_Datagrid;
        var $bn_advertisement_issue_list_toolbar = [{
                text:'<i class="fa fa-search" aria-hidden="true"></i>刷新',
                handler:function(){
                    $bn_advertisement_issue_list.reload();
                }
            }
        ];
        $(function(){
            //gird 初始化
            $bn_advertisement_issue_list_Datagrid = $('#bn_advertisement_issue_list_Datagrid').datagrid({
                filterBtnIconCls:'icon-filter',
                queryParams: {
                    "filter_EQ_delete_status" : 0,
                    "filter_EQ_putaway_status" : 2
                },
                pageSize : 20,
                remoteFilter:true
            });

            $bn_advertisement_issue_list_Datagrid.datagrid('enableFilter', [
                {
                    field:'isPermanent',
                    type:'combobox',
                    options:{
                        valueField: 'code',
                        textField: 'name',
                        data:json_sfyj
                    },
                    op:['equal']
                },
                {
                    field:'mediaClassify',
                    type:'combobox',
                    options:{
                        valueField: 'code',
                        textField: 'name',
                        data:json_mtfl
                    },
                    op:['equal']
                },
                {
                    field:'beginDate',
                    type:'datebox',
                    op:['equal','greaterorequal','lessorequal']
                },
                {
                    field:'endDate',
                    type:'datebox',
                    op:['equal','greaterorequal','lessorequal']
                },
                {
                    field:'page',
                    type:'combobox',
                    options:{
                        valueField: 'code',
                        textField: 'name',
                        url:'${ctx}/tcode/all/method?method=getCacheCdAdvertisementPage'
                    },
                    op:['equal']
                },
                {
                    field:'adPositionid',
                    type:'combobox',
                    options:{
                        valueField: 'code',
                        textField: 'name',
                        url:'${ctx}/tcode/all/method?method=getCacheCdAdPosition'
                    },
                    op:['equal']
                },
                {
                    field:'adType',
                    type:'combobox',
                    options:{
                        valueField: 'code',
                        textField: 'name',
                        url:'${ctx}/tcode/all/method?method=getCacheCdAdType'
                    },
                    op:['equal']
                },
                {field:'seq',type:'label'},
                {field:'seq',type:'label'},
                {field:'deviceSystem',type:'label'},
                {field:'pic',type:'label'},
                {field:'url',type:'label'},
                {field:'showWay',type:'label'},
                {field:'soldoutAt',type:'label'},
                {field:'soldoutBy',type:'label'},
                {field:'t',type:'label'}
            ]);

        });

        //刷新

        $bn_advertisement_issue_list.reload = function(){
            $bn_advertisement_issue_list_Datagrid.datagrid('reload');
        };

    </script>
</head>
<body>
<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'center',border:false">
        <table id="bn_advertisement_issue_list_Datagrid"  style="width:100%;height:100%"
               data-options="border:false,rownumbers:true,autoRowHeight:false,singleSelect:true,pagination:true,sortName:'createAt',sortOrder:'desc',toolbar:$bn_advertisement_issue_list_toolbar,rowStyler: function(index,row){return {style:'height:30px'};},url:'${ctx}/bn/advertisement/issue/up/search?_m=load',method:'post'">
            <thead>
            <tr>
                <th data-options="field:'adName',width:200,align:'center'">广告全称</th>
                <th data-options="field:'adShortName',width:150,align:'center'">广告简称</th>
                <th data-options="field:'pic',width:100,align:'center',formatter:
                    function(value,row,index){
                        if(row.pic==''||row.pic==undefined){
                            return '无';
                        }
                        return '<a href=\''+row.pic+'\' target=\'_blank\'>图片</a>'
                    }
                ">图片</th>
                <th data-options="field:'url',width:100,align:'center',formatter:
                    function(value,row,index){
                        if(row.url==''||row.url==undefined){
                            return '无';
                        }
                        return '<a href=\''+row.url+'\' target=\'_blank\'>地址</a>'
                    }
                ">访问地址</th>
                <th data-options="field:'seq',width:80,align:'center'">排序</th>
                <th data-options="field:'isPermanent',width:120,align:'center',formatter:
                    function(value,row,index){
                       if(row.isPermanent=='1'){
                           return '永久';
                       }else if(row.isPermanent=='2'){
                            return '非永久';
                       }
                    }
                ">是否永久</th>
                <th data-options="field:'beginDate',width:150,align:'center'">开始日期</th>
                <th data-options="field:'endDate',width:150,align:'center'">结束日期</th>
                <th data-options="field:'mediaClassify',width:160,align:'center',formatter:
                    function(value,row,index){
                       if(row.mediaClassify=='1'){
                           return 'app：移动应用';
                       }else if(row.mediaClassify=='2'){
                            return 'pc：电脑';
                       }
                    }
                ">媒体分类</th>
                <th data-options="field:'page',width:140,align:'center',formatter:
                    function(value,row,index){
                       return row.pageName;
                    }
                ">页面</th>
                <th data-options="field:'adPositionid',width:160,align:'center',formatter:
                    function(value,row,index){
                       return row.adPositionidName;
                    }
                ">广告位</th>
                <th data-options="field:'adType',width:110,align:'center',formatter:
                    function(value,row,index){
                       return row.adTypeName;
                    }
                ">广告类型</th>
                <th data-options="field:'deviceSystem',width:100,align:'center',formatter:
                    function(value,row,index){
                       if(row.deviceSystem=='1'){
                           return '苹果(ios)';
                       }else if(row.deviceSystem=='2'){
                            return '安卓(android)';
                       }else if(row.deviceSystem=='3'){
                            return '全部';
                       }
                    }
                ">设备系统</th>
                <th data-options="field:'showWay',width:80,align:'center',formatter:
                    function(value,row,index){
                       if(row.showWay=='1'){
                           return '轮播';
                       }else if(row.showWay=='2'){
                            return '静态';
                       }else if(row.showWay=='3'){
                            return '动态';
                       }else if(row.showWay=='4'){
                            return '列表';
                       }
                    }
                ">展示方式</th>
                <th data-options="field:'soldoutAt',width:150,align:'center'">下架时间</th>
                <th data-options="field:'soldoutBy',width:80,align:'center'">下架人</th>
                <th data-options="field:'t',width:20,align:'center'"></th>
            </tr>
            </thead>
        </table>
    </div>
</div>
</body>
</html>